var SixScene=SixScene||{};
SixScene.SixScene=function(){
	var s = this;
	F2xContainer.call(s);
	s.initUI();
	s.CurX=undefined;
	s.CurY=undefined;
	s.RootMC.RightMC.visible=false;
	s.RootMC.TopMC.visible=false;
	s.RootMC.LeftMC.visible=false;
	//监听每帧动画事件
    s.RootMC.addEventListener(annie.Event.CALL_FRAME,function (e) {
        switch (true){
            case e.data.frameName=="D2":
                s.RootMC.RightMC.visible=true;
                CountS.stopTime();
            break;
            case e.data.frameName=="D3":
                s.RootMC.TopMC.visible=true;
                CountS.stopTime();
                break;
            default:
                s.RootMC.LeftMC.visible=true;
                CountS.stopTime();
                break;
        }
    });
    s.RootMC.addEventListener(annie.MouseEvent.MOUSE_DOWN,function(e){
        switch (true){
            case s.RootMC.RightMC.visible:
                 s.CurX = e.clientX;
            break;
            case s.RootMC.TopMC.visible:
                 s.CurY = e.clientY;
            break;
            case s.RootMC.LeftMC.visible:
                 s.CurX = e.clientX;
            break;

        }
    });
    s.RootMC.addEventListener(annie.MouseEvent.MOUSE_UP,function (e) {
        switch (true){
            case s.RootMC.RightMC.visible:
                if(e.clientX-s.CurX>=40){
                    s.RootMC.RightMC.visible=false;
                    s.RootMC.play();
                    CountS.runTime();
                };
            break;
            case s.RootMC.TopMC.visible:
                if(e.clientY-s.CurY<=40){
                    s.RootMC.TopMC.visible=false;
                    s.RootMC.play();
                    CountS.runTime();
                };
            break;
            default:
                if(e.clientX-s.CurX<=40){
                    s.RootMC.LeftMC.visible=false;
                    s.RootMC.play();
                    CountS.runTime();
                }
            break;
        }
    })
    //动画结束时间
    s.RootMC.addEventListener(annie.Event.END_FRAME,function () {
        s.nextScene();
    })
};



F2xExtend(SixScene.SixScene,F2xContainer);

SixScene.SixScene.prototype.nextScene= function(){
    var s = this;
    RootStage.addChild(new SevenScene.SevenScene());
    RootStage.removeChild(s);
    CountS.visible=false;
}

SixScene.SixScene.prototype.initUI=function(){
	var s = this;
	//f2x_auto_created_init_start
	var _d0=new SixScene.xcbdghgj();
	_d0.name="RootMC";
	s.RootMC=_d0;
	s.addChild(_d0);
	//f2x_auto_created_init_end
	
};
